package com.example.basic.domain;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
public class Games {

    @NotNull(message = "id不能为空")
    private Integer id;

    @NotNull(message = "name不能为空")
    private String name;

    @DecimalMin(value = "1", message = "价格必须大于{value}")
    @DecimalMax(value = "300", message = "价格必须小于{value}")
    private BigDecimal price;

    @Range(min = 1, max = 10, message = "分数必须在{min}到{max}之间")
    private Double score;
}
